package com.cie2.janji.pages.admin;

import org.apache.log4j.Logger;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.hibernate.annotations.CommitAfter;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.cie2.janji.base.CieAdminPage;
import com.cie2.janji.entities.EntityRole;
import com.cie2.janji.services.EntityRoleService;

public class CreateEntityRole extends CieAdminPage{

	static Logger logger =
	       Logger.getLogger(CreateEntityRole.class.getName());

	@Property
	private EntityRole role;
	
	//services
    @Inject
    private EntityRoleService entityRoleService;
    
    @CommitAfter
    Object onSuccess()
    {    	

    	entityRoleService.add(role);
		return EntityRoleList.class;
		
    }
}